package com.itheima.mapper;

import com.itheima.bean.Student;
import com.itheima.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentDao {

    //分页查询
    @Select("select * from student")
    List<Student> findAll();


    //添加学生
    @Insert("INSERT INTO student VALUES (#{number},#{name},#{birthday},#{address})")
    void  add(Student student);


    //修改学生
    @Update("UPDATE student SET name = #{name},birthday=#{birthday},address=#{address} where number = #{number}")
    void update(Student student);

    //删除学生
    @Delete("DELETE FROM student WHERE number=#{number}")
    void del(String number);
}
